const SequelizeRepository = require('../../../shared/repository/SequelizeRepository')

class MenuRepository extends SequelizeRepository {
  constructor({ database, menuCoverter }) {
    super({
      coverter: menuCoverter,
      model: database.models.Menu,
    })
  }

  async findByCode(code) {
    return await this.findOne({ where: { code } })
  }
  async findBySystemIdAndCode(systemId, code) {
    return await this.findOne({ where: { systemId, code } })
  }
}

module.exports = MenuRepository
